<?php
/**
 * alltosun.com  test_helper.php
 * ============================================================================
 * 版权所有 (C) 2009-2013 北京互动阳光科技有限公司，并保留所有权利。
 * 网站地址: http://www.alltosun.com
 * ----------------------------------------------------------------------------
 * 许可声明：这是一个开源程序，未经许可不得将本软件的整体或任何部分用于商业用途及再发布。
 * ============================================================================
 * $Author: 王德康 (wangdk@alltosun.com) $
 * $Date: 2015-12-14 下午6:14:09 $
 * $Id$
 */

class Action
{
    public function send()
    {
         // 找回密码
         var_dump(aliysms_helper::send_forgot_password('18618155653', '123455'));

         // 签约
         var_dump(aliysms_helper::send_signed('18618155653', '123455', '【抱抱堂商户端】'));

         // 配送
         var_dump(aliysms_helper::send_delivery('18618155653', '123455', '【抱抱堂商户端】'));

    }


    public function test()
    {


        $store_name = Request::getParam('store_name', '测试商店名');
        $name       = Request::getParam('name', '小明');
        $order_id   = Request::getParam('order_id', '111222333444');
        $phone_num  = Request::getParam('phone_num', '18844100485');
        $code       = Request::getParam('code', '1234');

        $sms_code   = Request::getParam('sms_code', 'SMS_3495149');
        $phone_num  = Request::getParam('mobile', '18618155653');
        $sign_name  = Request::getParam('sign_name', '抱抱堂');

        $arr = array(
        	'store_name'=>$store_name,
            'name'      => $name,
            'order_id'  => $order_id,
            'phone_num' => $phone_num,
            'code'      => $code
        );

        an_dump(aliysms_helper::sms_send($sign_name, $arr, $phone_num, $sms_code));
    }


    public function test_sms()
    {
        $order_id = '201502321232';
        $replace_arr = array('order_id' => $order_id, 'phone_num' => '15010951593');
        // aliysms_helper::sms_send('抱抱堂', $replace_arr, '15010951593', 'SMS_3495033');
        //发推送消息以及站内信
        $return_data = message_center_helper::get_config_add_message('store_delivery_finished', $replace_arr, '44922', 'store', $order_id, 1, 'arrival');
        var_dump($return_data);
    }

    public function test_push()
    {
        $return_result = _widget('push')->send('test', array('44922'), 'store');
        var_dump($return_result);
    }

}